﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Diagnostics;

namespace BackgrounderService
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {

            var Processes = System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
            foreach (Process p in Processes)
            {
                if (p.Id != Process.GetCurrentProcess().Id)
                {
                    MessageBox.Show("Another Instance is running!");
                    return;
                }
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}
